<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use Illuminate\Support\Facades\Log;
use App\Model\UserEnergy;


class Energy extends Command
{
	/**
	 * The name and signature of the console command.
	 *
	 * @var string
	 */
	protected $signature = 'energy';

	/**
	 * The console command description.
	 *
	 * @var string
	 */
	protected $description = '清除签到油桶数量';//够30天就清空业绩

	/**
	 * Create a new command instance.
	 *
	 * @return void
	 */
	public function __construct()
	{
		parent::__construct();
	}

	public function handle()
	{
		//
		Log::info('自动打印,清除油桶');
		//判断是否够30天,够30天将天数和业绩归0
		UserEnergy::where('id','<>',0)->update(['sys_num' => 0, 'sys_num_two' => 0]);
	}
}